package studio.raptor.ddal.dashboard.log.service;

import lombok.Getter;
import lombok.Setter;
import org.springframework.stereotype.Service;
import studio.raptor.ddal.dashboard.log.common.LogServerConstant;
import studio.raptor.ddal.dashboard.log.service.interfaces.ILogStorageService;
import javax.annotation.Resource;

/**
 * Created by dell on 2018/1/5.
 */
@Getter
@Setter
@Service
public class LogStorageServiceUtil {

    @Resource
    private ILogStorageService logStorageMysqlService;
    @Resource
    private ILogStorageService logStorageOracleService;

    public ILogStorageService getLogStorageService(String databaseType){
        if(LogServerConstant.DATABASE_MYSQL.equalsIgnoreCase( databaseType )){
            return logStorageMysqlService;
        }
        else if(LogServerConstant.DATABASE_ORACLE.equalsIgnoreCase( databaseType )){
            return logStorageOracleService;
        }
        return logStorageMysqlService;
    }

}

